package cn.ulyer.common.utils;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class PageResult<T>  implements Serializable {

    private Integer pages;

    private Integer size;

    private List<T> records;

    private Integer total;

    public static PageResult of(Integer total, Integer size,List<?> data){
        PageResult pageResult = new PageResult();
        pageResult.setRecords(data);
        pageResult.setSize(size);
        pageResult.setTotal(total);
        return pageResult;
    }

}
